﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using SeDuce.IDAL;

namespace SeDuce.BLL
{
    public class ProductBLL
    {
        private static readonly IProductDAL dal = SeDuce.DALFactory.DataAccess.CreateProductDAL();

        public DataTable GetProducts()
        {
            return dal.GetProducts();
        }

        public DataTable GetProductsTop(int num)
        {
            return dal.GetProductsTop(num);
        }

        public DataTable GetProductByProductID(int productID)
        {
            return dal.GetProductByProductID(productID);
        }

        public DataTable GetBrandsByProductID(int productID)
        {
            return dal.GetBrandsByProductID(productID);
        }

        public DataTable GetTypesByProductID(int productID)
        {
            return dal.GetTypesByProductID(productID);
        }

        public DataTable GetProductsByIDs(string IDs)
        {
            return dal.GetProductsByIDs(IDs);
        }

        public bool UpdateProduct(SeDuce.Model.Product product, List<int> brandIDs, List<int> typeIDs)
        {
            return dal.UpdateProduct(product, brandIDs, typeIDs);
        }

        public object InsertProduct(SeDuce.Model.Product product, List<int> brandIDs, List<int> typeIDs)
        {
            return dal.InsertProduct(product, brandIDs, typeIDs);
        }

        public bool DeleteProduct(int productID)
        {
            return dal.DeleteProduct(productID);
        }
    }
}
